package com.soft.admin.action;

import java.util.List;

import javax.annotation.Resource;

import com.soft.admin.service.IMenuService;
import com.soft.mapping.Menu;
import com.soft.util.Handle;
import com.soft.util.MyActionSupport;

public class MenuAction extends MyActionSupport {

	@Resource
	private IMenuService iMenuService;

	@Override
	public String execute() throws Exception {
		List<Menu> menulist = iMenuService.getParentMenuList(null);
		request.setAttribute("menulist", menulist);
		return super.execute();
	}

	public String submenu() throws Exception {
		Integer parentid = Handle.getInteger(request.getParameter("parentid"));
		List<Menu> menulist = iMenuService.getParentMenuList(parentid);
		request.setAttribute("menulist", menulist);
		return super.execute();
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

}
